﻿var $AdministratorLayout;
if (typeof Axis == "undefined") Axis = {};
if (typeof Axis.Admin == "undefined") Axis.Admin = {};
Axis.Admin.Main = {
    Init: function () {
        var thisObj = this;
        thisObj.Layout.Init();
        thisObj.Navigation.Init();
        thisObj.EventClick();
    },
    Layout: {
        Instance: null,
        Init: function () {
            var thisObj = this;
            var options = {
                north: {
                    size: 136,
                    spacing_closed: 0,
                    spacing_open: 0,
                    showOverflowOnHover: true
                },
                east: {
                    initClosed: true
                },
                south: {
                    initClosed: true,
                    spacing_closed: 0
                },
                west: {
                    initClosed: true,
                    spacing_closed: 0
                }
            };
            thisObj.Instance = $('body').layout(options);
        }
    },
    Navigation: {
        ID: '#mega-menu-tut',
        Init: function () {
            var thisObj = this;
            $(thisObj.ID).dcMegaMenu({
                rowItems: '3',
                speed: 'fast'
            });
        }
    },
    EventClick: function () {
        var thisObj = this;
        $("#north-toggle").hover(function () {
            $(this).addClass("ui-layout-toggler-north-hover");
        }, function () {
            $(this).removeClass("ui-layout-toggler-north-hover");
        });
        $("#north-toggle").click(function (e) {
            if ($(this).hasClass("ui-layout-toggler-north-open")) {
                $("#north-toggle").removeClass("ui-layout-toggler-north-open");
                $("#north-toggle").addClass("ui-layout-toggler-north-closed");
                $(".main-header").hide();
                
                thisObj.Layout.Instance.sizePane('north', 46);
            }
            else {
                $("#north-toggle").removeClass("ui-layout-toggler-north-closed");
                $("#north-toggle").addClass("ui-layout-toggler-north-open");
                $(".main-header").show();
                thisObj.Layout.Instance.sizePane('north', 136);
            }
            $(window).trigger("resize");
            e.stopPropagation();
        });
    }
};
$(function () {
    Axis.Admin.Main.Init();
});